window.c_methods = {
  getDocId: function () {
    return window.external.C_GetDocId()
  },
  getDocInfo: function () {
    return window.external.C_GetDocInfo()
  },
  getParagraphSize: function () {
    return window.external.C_GetParagraphSize()
  },
  getParagraph: function (index) {
    return window.external.C_GetParagraph(index)
  },
  getParagraphStyle: function (index) {
    return window.external.C_GetParagraphStyle(index)
  },
  setParagraphStyle: function (index, styleJson) {
    return window.external.C_SetParagraphStyle(index, JSON.stringify(styleJson))
  },
  getParagraphs: function () {
    return window.external.C_GetParagraphs()
  },
  selectRange: function (start, end) {
    return window.external.C_SelectRange(start, end)
  },
  getRangeText: function (start, end) {
    return window.external.C_GetRangeText(start, end)
  },
  getRangeFont: function (start, end) {
    return window.external.C_GetRangeFont(start, end)
  },
  setRangeFont: function (start, end, fontJson) {
    return window.external.C_SetRangeFont(start, end, JSON.stringify(fontJson))
  },
  replaceRangeText: function (start, end, text) {
    return window.external.C_ReplaceRangeText(start, end, text)
  },
  getNowRange: function () {
    return window.external.C_GetNowRange()
  },
  openWord: function (url) {
    return window.external.C_OpenWord(url)
  },
  openPdf: function (url) {
    return window.external.C_OpenPdf(url)
  },
  insertWord: function (start, end, url) {
    return window.external.C_InsertWord(start, end, url)
  },
  getBookmarks: function () {
    return window.external.C_GetBookmarks()
  },
  removeBookmarks: function () {
    return window.external.C_RemoveBookmarks()
  },
  getBookmark: function (name) {
    return window.external.C_GetBookmark(name)
  },
  removeBookmark: function (name) {
    return window.external.C_RemoveBookmark(name)
  },
  createBookmark: function (name, start, end) {
    return window.external.C_CreateBookmark(name, start, end)
  },
  writeToken: function (token) {
    return window.external.C_WriteToken(token)
  },
  removeToken: function () {
    return window.external.C_RemoveToken()
  },
  openLoginForm: function () {
    return window.external.C_OpenLoginForm()
  },
  closeLoginForm: function () {
    return window.external.C_CloseLoginForm()
  }
};

function j_accept_data(data) {
  window.postMessage(data, '*');
}
